package com.tarena.lbs.basic.web.assemble;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.TypeReference;
import com.tarena.lbs.pojo.basic.vo.AreaVO;
import com.tarena.lbs.pojo.basic.vo.ArticleItemTag;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class AdminAccessmbler {
    public List<AreaVO> assembleAreaTags(){
        String tagsJson="[{\n" +
                "\t\"id\": 1,\n" +
                "\t\"parentId\": 0,\n" +
                "\t\"name\": \"北京市\",\n" +
                "\t\"children\": [{\n" +
                "\t\t\"id\": 2,\n" +
                "\t\t\"parentId\": 1,\n" +
                "\t\t\"name\": \"北京市市辖区\",\n" +
                "\t\t\"children\": [{\n" +
                "\t\t\t\t\"id\": 3,\n" +
                "\t\t\t\t\"parentId\": 2,\n" +
                "\t\t\t\t\"name\": \"东城区\",\n" +
                "\t\t\t\t\"children\": null\n" +
                "\t\t\t},\n" +
                "\t\t\t{\n" +
                "\t\t\t\t\"id\": 4,\n" +
                "\t\t\t\t\"parentId\": 2,\n" +
                "\t\t\t\t\"name\": \"西城区\",\n" +
                "\t\t\t\t\"children\": null\n" +
                "\t\t\t},\n" +
                "\t\t\t{\n" +
                "\t\t\t\t\"id\": 5,\n" +
                "\t\t\t\t\"parentId\": 2,\n" +
                "\t\t\t\t\"name\": \"朝阳区\",\n" +
                "\t\t\t\t\"children\": null\n" +
                "\t\t\t}\n" +
                "\t\t]\n" +
                "\t}]\n" +
                "}]";
        TypeReference<List<AreaVO>> typeReference = new TypeReference<List<AreaVO>>() {
        };
        List<AreaVO> resultMap = JSON.parseObject(tagsJson, typeReference);
        return resultMap;
    }
}
